<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.io.PrintWriter"%>
<%@ page import="java.util.*"%>
<%@ page import="javax.servlet.*"%>
<%@ page import="net.sf.json.*"%>
<%@page import="model.MonHocM"%>
<%@page import="dao.MonHocD"%>
<%
	JSONArray jsonarray = new JSONArray();
	String iddv = request.getParameter("id");
	if (iddv != null) {
		MonHocD dao = new MonHocD();
		ArrayList<MonHocM> ls = dao.loadMonHocDonVi1(Integer.parseInt(iddv));
		for (int i = 0; i < ls.size(); i++) {
			JSONObject obj = new JSONObject();
			obj.put("id", ls.get(i).getId_mon_hoc());
			obj.put("ma", ls.get(i).getMa());
			obj.put("ten", ls.get(i).getTen());
			jsonarray.add(obj);
		}
	}
	PrintWriter ou = response.getWriter();
	ou.println(jsonarray);
	ou.flush();
	ou.close();
%>